package com.dz.service.impl;

import com.dz.bean.Rate;
import com.dz.mapper.RateDao;
import com.dz.service.RateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RateServiceImpl implements RateService {
    @Autowired
    RateDao rateDao;

    @Override
    public Boolean addRate(Rate rate) {
        int result = rateDao.addRate(rate);
        return result > 0;
    }

    @Override
    public Double getRateByGuideId(Integer guideId) {
        return rateDao.getRateByGuideId(guideId);
    }

    @Override
    public List<Rate> getRateByVisitorAndGuide(Integer visitorId, Integer guideId) {
        return rateDao.getRateByVisitorAndGuide(visitorId, guideId);
    }
}
